/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.bean;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 说明：
 * Entity Name 权限表
 * @Author：李智深
 * @Date：2012-03-14
 */
@Entity
@Table(name="ruipeng_tb_TRight")
public class TRight implements Serializable{

	private static final long serialVersionUID = 1L;

	private String RightID;//权限编号CHAR(15)PK
	
	private byte Level;//权限级别TINYINT
	
	private String Des;//权限描述VARCHAR(256)
	
	private String Name;//权限名VARCHAR(64)
	private Boolean isChecked;//权限名VARCHAR(64)
	
	private Set<TRoleRight> TRoleRights=new HashSet<TRoleRight>(0);//角色权限

	@Id
	@Column(name = "RightID", length=15)
	public String getRightID() {
		return RightID;
	}

	public void setRightID(String rightID) {
		RightID = rightID;
	}

	@Column(name = "Level")
	public byte getLevel() {
		return Level;
	}

	public void setLevel(byte level) {
		Level = level;
	}

	@Column(name = "Des", length=256)
	public String getDes() {
		return Des;
	}

	public void setDes(String des) {
		Des = des;
	}

	@Column(name = "Name", length=64)
	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}

	@OneToMany(mappedBy="TRight")
	@JoinColumn(name="RightID")
	public Set<TRoleRight> getTRoleRights() {
		return TRoleRights;
	}

	public void setTRoleRights(Set<TRoleRight> tRoleRights) {
		TRoleRights = tRoleRights;
	}
	
	@Override
	public String toString() {
		return this.Name;
	}

	public Boolean getIsChecked() {
		return isChecked;
	}

	public void setIsChecked(Boolean isChecked) {
		this.isChecked = isChecked;
	}
}
